home *** CD-ROM | disk | FTP | other *** search
- VB Book Version 1.3
- 30 March 93
-
-
- IMPORTANT: Don't forget to read UPDATES at the end of this document!
- ---------------------------------------------------------
-
- Utility to print ASCII text files to LaserJet Series II, IIp, or III
- printers in booklet format (4 pages to a sheet).
-
- Based on the program, PC Book, by Jay Munro, Copyright 1990 PC Magazine -
- Ziff Davis - Jay Munro.
-
- Originally written by Jay Munro in Quick Basic 4.5 and converted to Visual
- Basic by Dennis Scott on September 1, 1991. Updated to version 1.3
- March, 1993.
-
- USE AND DISTRIBUTION:
-
- VB Book Version 1.3 can be freely used and distributed by any person or
- company but it's not to be sold. Distributors and BBS operators are
- permitted to charge distribution fees as they see fit.
-
- PURPOSE:
-
- VB Book prints README and similar ASCII files in booklet format on an HP
- LaserJet II, IIp, or III printer. Uses two-sided printing in landscape mode,
- with Line Printer font (Courier 16.6) so that four standard pages of up to
- 80 characters per line, 66 lines per page are printed on each sheet without
- formatting changes.
-
- REMARKS:
-
- The filename can designate any ASCII text file in which each line is
- terminated with a Carriage Return/Line Feed combination. Page Feed characters
- can be added to force breaks in addition to those implicit in the 60-line
- (68-line if a header is used) page length.
-
- The original switches in PC Book have been replaced with Windows Checkboxes.
- Any or all of the Checkboxes can be used to create a one-line header that
- prints the filename, page number, and date, on all but blank pages. The Wrap
- Checkbox causes lines exceeding the configurable line length to wrap; by
- default such lines are wrapped. Configurable line length was added in version
- 1.1 (see "Updates" below) so that space could be left on the left side for
- hole punching. A4 (European) paper size was added in version 1.3.
-
- Output can be directed to LPT1, LPT2, COM1, COM2, or File. Note that
- you must set the proper parameters for your port before printing to a COM
- port. If File is selected, you will be prompted to enter an output filename
- and two PRN files will be created, ready to be copied to the printer.
-
- VB Book sequences the page printing so that all side-one pages are printed in
- one pass. The sheets are then put back in the LaserJet paper tray and all
- side-two pages are printed. The finished booklet can then be created with a
- single fold. When using the normal (top) LaserJet output bin the pass-one
- sheets should be reinserted in the paper tray without any relative change
- in orientation. If rear output from the printer is used, the sheets must be
- turned over as a group before reinsertion. If you wish to hole punch the
- finished product, set the line length to something less that 80 (or 90 if
- using A4 paper). Line lengths of 75 to 76 (A2 (American) paper) seem to
- work real well for hole punching.
-
- REQUIREMENTS:
-
- VB Book requires Windows 3.x. The Visual Basic Run Time file, VBRUN100.DLL,
- must be in the path (recommend putting it in your Windows directory).
- Modifications will require Microsoft Visual Basic Version 1.0 or greater.
- Both the executable and the source files for VB Book are provided.
-
- COMMENTS TO QuickBASIC PROGRAMMERS:
-
- The conversion of PC Book from QuickBASIC to Visual Basic (VB) was undertaken
- as an exercise in converting original QuickBASIC (QB) source code into VB code.
- It was surprisingly easy!
-
- The hardest part was deciding HOW the screens (forms in VB) should look.
- Actually designing the forms is very easy. Once the forms were designed, I
- just used "load text" to get the original QB code into the main form. VB does
- almost everything automatically. For example, all SUBs are automatically
- created and the old code placed in them.
-
- Some things will need to be changed, of course. Any input from the user
- (QBs Input, Line Input, and Inkey commands) needs to converted to "InputBox$"
- functions. Similarly, the "print" statements (with corresponding Locate's)
- were converted to "MsgBox" functions or a form created to place them onto.
- The QB code that performed initialization was placed in the main form's
- Form_Load procedure. All Declare's were removed. Most of the above changes
- were accomplished by pressing F5 (run) and letting VB tell me what it didn't
- like. I just used the ol' cut & paste to put things in the right place.
-
- I then defined what should happen when each of the controls on the forms were
- activated (usually clicked) and wrote the code into those areas. Putting the
- drive, directory, and file selection boxes on the screen and activating them
- is phenomenally easy!
-
- The overall concepts of VB are a little difficult to comprehend at first but
- then it clicks and it all becomes quite simple. I would highly recommend that
- you take the tutorial before doing anything. If you don't, you will not
- comprehend what's going on and will probably get disgusted and quit.
-
- This conversion took about a day to do because of having to learn VB. If I
- had to do it again I could probably complete it in an hour or less. Please
- note that the code has not been "cleaned up" - some debugging code may still
- be there.
-
- RECOMMENDED ADDITIONS:
-
- Want some practice with VB? Why not add: A screen preview of output while
- printing (or before printing or instead of printing) and status display of
- percent completed.
-
- If anyone adds this capability or changes the code in some other way, please
- be kind enough to send me a copy of the source code.
-
- Please send comments or suggestions to:
-
- Dennis Scott
- CompuDirect
- 7711 Butler Road
- Myrtle Beach, SC 29575-6628
- (803)650-7460
- CompuServe ID: 71360,3701
-
- DISCLAIMER:
-
- The standard disclaimer applies: Use this program at your own risk. I will
- not be held responsible for anything!
-
-
- UPDATES:
-
- Version 1.1, December 18, 1991. Added the following features:
-
- 1. Status display to give an indication that the program is really printing.
- It is also used to display totals, source file, and destination.
-
- 2. Added the capability to set the line length which in effect allows the
- margins to be set. This feature was added so that people could use a
- hole punch if needed (added at the request of Norman Levenstein;
- 70366,140). With this set to other than the default, recommend that
- you edit your text file so that its line length is equal to or less than
- this setting. Otherwise, the lines will wrap at the right edge (or be
- cut off if line wrap is turned off).
-
- 3. Added the ability to cancel before starting to print side 2, i.e., if the
- first side is not what you really wanted then why print the second side.
-
- 4. Cleaned up the code somewhat. It's still not real pretty but this is a
- free program!
-
- Version 1.2, March 9, 1993.
-
- 1. Changed info screens to reflect our change of address and telephone
- number.
-
- 2. Cleaned up the code a little more. Still not great but better.
-
- 3. Added a new file called SOURCE.DOC to the distribution archive. It
- is the source code listing from version 1.0 and is included so that
- people without Visual Basic can see the source code and thus make a
- determination of whether to start using VB or not. This file is not
- needed to use nor change VB Book.
-
- Version 1.3, March 30, 1993.
-
- 1. Added A4 capability at the request of Mick Ellis of Cogent Software,
- Letchworth, Herts., England.
-
- NOTE: I do not have the capability to thoroughly test this added
- ---- feature due to the lack of A4 paper here in the States. The
- code 'should' work but if anyone finds a fault please let
- me know.
-
- 2. Changed the 'Print to File' section. It now creates two files
- instead of just one. With only one PRN file being created, it was
- not possible to reinsert the paper in the middle. To use the two
- PRN files, first copy 1xxxxxxx.PRN to the printer. When done
- printing, reinsert the paper in the printer and copy 2xxxxxxx.PRN
- to the printer. Be advised that these two files are NOT ASCII
- files -- they have printer codes imbedded within and therefore
- you must use the following command when copying to the printer:
-
- COPY 1xxxxxxx.PRN PRN /b
- ... reinsert paper then
- COPY 2xxxxxxx.PRN PRN /b
-
- Of course, replace the x's with the proper filename.
-
- When prompted to enter an output filename, if you use a filename
- prefix of 8 characters in length, the last character will be dropped
- in order to put a '1' on the front of the filename. This is a DOS
- limitation not mine.
-
- 3. If you have tabs in the document you want to print, you may want to
- remove them before processing with VB Book. Otherwise, VB Book will
- print the tabs as 8 spaces which could upset your line spacing and cause
- text to wrap (if on) or be cut off at the right margin. If your
- printouts 'bleed over' to the next page for no apparent reason,
- you probably have tabs in the document that need to be removed.
-
- 4. VB Book will now yield time to other running applications while
- computing the number of pages and when printing.
-
- 5. Removed the blacked out background screen so that users can now
- see the desktop. A fullfilment of another request by Mick Ellis.
-
- 6. VB Book no longer ends when finished printing but rather returns
- to the main screen. Choose 'Cancel' to quit the program.
-
- 7. NOTE: The current version of VB Book does not use Windows printing
- facilities. It bypasses Windows and sends raw LaserJet printer codes
- directly to the printer. A future version (hopefully) will have the
- ability to print preview and select an optional Windows font.
-
- 8. Note that the only size limit on an input file is that it can not
- be larger than 512 output pages. I have tested VB Book on input
- text files as large as 200K -- not even a burp!
-
- IF ANYONE HAS SOME SAMPLE VISUAL BASIC CODE THAT DETAILS SELECTION OF FONTS
- AND PRINTING PROPORTIONAL FONTS TO THE PRINTER, PLEASE SEND ME A COPY.
-
- I have to work for a living so can't spend forever working on a Free program!
- Any code samples that you send will allow me to add features to VB Book in
- a more timely manner and may make the difference between getting or not
- getting the features added! In return, your name will be placed in this
- file as a generous provider and assistant.
-
-
-
-
-